function startup_tgc
    disp("tool gravity compensation")
    
    if verLessThan("matlab", "9.7")
        warning("You are running a low version of MATLAB, so you may meet some problems.");
    end
    
    % get absolute path of tool-gravity-compensation
    [startup_path,~,~] = fileparts(mfilename('fullpath')); 
    
    if any(contains(path, startup_path))
        disp("already exist.")
    else
        sub_dirs = ["data", "src", "models", "test"];
        add_subdirs_path(startup_path, sub_dirs);
        disp("startup finished!")
    end
    
end

function add_subdirs_path(cur_dir, sub_dirs)
    for i = 1 : length(sub_dirs)
        add_path = fullfile(cur_dir, sub_dirs(i));
        addpath(add_path);
    end
    savepath
end
